<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>

    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
<script type="text/javascript">
	function xml() {
		var xmls = new Array();
		var endxs = '</urlset>\n';
		var startx = "	<url>\n		<loc>http://";
		var endx = "</loc>\n	</url>\n";
		var result = '<?xml version="1.0" encoding="UTF-8"?>\n\n<urlset>\n';
		xmls = document.getElementById('console').value.split('http://');
		xmls.shift();
		for(z in xmls) {
   			result = result + startx + xmls[z].replace('\n','') + endx;
		}
		result = result + endxs;
		document.getElementById('console1').value = result;
	}
</script>	


 </head>
  <body>
    <h1>你好，世界！</h1>
    <div><textarea id="console" class="form-control" rows="8" style="width: 383px; margin: 0px 154.1875px 0px 0px; height: 174px;" autocomplete="off"></textarea></div>
    <div class="btn-group">
				<button class="btn btn-default" name="submit" type="submit" id="commentsubmit" onclick="xml();">生成</button>
	</div>
    <div><textarea id="console1" class="form-control" rows="8" style="width: 600px; margin: 0px 154.1875px 0px 0px; height: 174px;" autocomplete="off"></textarea></div>

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>

	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
  </body>
</html>